﻿using System.Collections.Generic;
using XSerialization.Generator;

namespace XSerialization.Templates
{
    public partial class ClassTemplate
    {
        /// <summary>
        /// List of all complex Types
        /// </summary>
        public XsdComplexType Item { get; set; }

        /// <summary>
        /// Meta Informations
        /// </summary>
        public IFileMetaInfo MetaInfo { get; set; }

        /// <summary>
        /// List of all Interfaces
        /// </summary>
        public IList<string> Interfaces { get; set; }

        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="item">Class declaration</param>
        /// <param name="metaInfo">Meta Informations</param>
        public ClassTemplate(XsdComplexType item, IFileMetaInfo metaInfo)
        {
            MetaInfo = metaInfo;
            Item = item;

            Interfaces = new List<string>(MetaInfo.Interfaces);
            Interfaces.Insert(0, Item.InterfaceName);
        }
    }
}
